package com.hadwinling.blog.service.impl;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.hadwinling.blog.entity.Article;
import com.hadwinling.blog.mapper.ArticleMapper;
import com.hadwinling.blog.service.ArticleService;

import java.util.List;

/**
 * @author HadwinLing
 * @version V1.0
 * @Package com.hadwinling.blog.service.impl
 * @date 2020/8/19 22:02
 */
@Service
public class ArticleServiceImpl implements ArticleService {

    @Resource
    private ArticleMapper articleMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return articleMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Article record) {
        return articleMapper.insert(record);
    }

    @Override
    public int insertSelective(Article record) {
        return articleMapper.insertSelective(record);
    }

    @Override
    public Article selectByPrimaryKey(Integer id) {
        return articleMapper.selectByPrimaryKey(id);
    }

    @Override
    public int countByState(int state) {
        return articleMapper.countByState(state);
    }

    @Override
    public List<Article> selectAllByState(Integer state) {
        return articleMapper.selectAllByState(state);
    }

    @Override
    public Article selectAllByStateAndId(Integer state, Integer articleid) {
        return articleMapper.selectAllByStateAndId(state, articleid);
    }

    @Override
    public List<Article> selectAllSelective(Article article) {
        return articleMapper.selectAllSelective(article);
    }

    @Override
    public List<Article> selectAllByAdminid(Integer adminid, Integer limitnum) {
        return articleMapper.selectAllByAdminid(adminid, limitnum);
    }

    @Override
    public int updateByPrimaryKeySelective(Article record) {
        return articleMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Article record) {
        return articleMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Article> selectAllByStateAndTop(Integer state, Integer top) {
        return articleMapper.selectAllByStateAndTop(state, top);
    }

    @Override
    public List<Article> selectAllByStateAndTagid(Integer state, Integer tagid) {
        return articleMapper.selectAllByStateAndTagid(state, tagid);
    }

    @Override
    public int updateTopById(Integer updatedTop, Integer id) {
        return articleMapper.updateTopById(updatedTop, id);
    }

    @Override
    public List<Article> selectAllByStateAndTagidAndAdminId(Integer state, Integer tagid, Integer adminid) {
        return articleMapper.selectAllByStateAndTagidAndAdminId(state, tagid, adminid);
    }

    @Override
    public List<Article> selectAllByAdminidAndState(Integer adminid, Integer state) {
        return articleMapper.selectAllByAdminidAndState(adminid, state);
    }

    @Override
    public List<Article> selectAllByAdminIdAndTitleAndTag(Article article) {
        return articleMapper.selectAllByAdminIdAndTitleAndTag(article);
    }

    @Override
    public List<Article> selectAllByStateAndTagidAndLimit(Integer state, Integer tagid, Integer limitnum) {
        return articleMapper.selectAllByStateAndTagidAndLimit(state, tagid, limitnum);
    }

    @Override
    public int countLikeById(Integer adminid) {
        return articleMapper.countLikeById(adminid);
    }

    @Override
    public List<Article> selectAllByStateOrderByCreatetimeDesc(Integer state) {
        return articleMapper.selectAllByStateOrderByCreatetimeDesc(state);
    }

}


